package com.example.villagemanager.network.api;



import com.example.villagemanager.model.bean.Menu;
import com.example.villagemanager.model.bean.Person;
import com.example.villagemanager.model.entity.BaseResponse;
import com.example.villagemanager.model.response.PersonPagesResponse;
import com.example.villagemanager.model.response.UserLoginResp;
import com.example.villagemanager.network.UrlDefine;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface AppInfoApi {

    @POST(UrlDefine.LOGIN)
    Observable<BaseResponse<UserLoginResp>> submit(@Query("loginName") String userName, @Query("password") String userPass);

    @POST(UrlDefine.LOGIN)
    Observable<BaseResponse<UserLoginResp>> userLogin(@Query("username") String userName, @Query("password") String userPass, @Query("userType") int userType);

    @POST(UrlDefine.PERSON_PAGE)
    Observable<BaseResponse<PersonPagesResponse>> personPage(@Query("regionId") Integer regionId, @Query("pageNum") Integer pageNum, @Query("pageSize") Integer pageSize);

    @POST(UrlDefine.MENU_LIST)
    Observable<BaseResponse<List<Menu>>> menuList(@Query("userId") int userId,@Query("parentId") int parentId);
    @POST(UrlDefine.PERSON_FIND)
    Observable<BaseResponse<Person>> findPerson(@Query("personId") int personId);
}
